<template>
	<view>
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
			<block slot="content">注册</block>
		</cu-custom>
		<view class="card-box border-bottom">
			<view class="card-info">
				<view class="card-title">添加银行卡</view>
				<view class="card-tip">请绑定法人本人的银行卡</view>
			</view>
		</view>
		<view class="form-box">
			<view class="form">
				<u-form :model="form" ref="uForm">
					<u-form-item label="持卡人" :rightIconStyle="{color: '#C1C1C1', fontSize: '16px'}" right-icon="info-circle" required label-width="250">
						<u-input placeholder="请输入真实姓名" v-model="form.bankHolder" type="text" />
					</u-form-item>
					<u-form-item label="卡号" :rightIconStyle="{color: '#C1C1C1', fontSize: '16px'}" right-icon="camera" required label-width="250">
						<u-input placeholder="持卡人本人银行账号" v-model="form.bankAccount" type="idcard" />
					</u-form-item>
					<u-form-item label="银行大行号" required label-width="250">
						<u-input placeholder="此处必填…" v-model="form.bankDaHangCode" type="idcard" />
					</u-form-item>
					<u-form-item label="银行大区编号" required label-width="250">
						<u-input placeholder="此处必填…" v-model="form.bankAreaCode" type="text" />
					</u-form-item>
					<u-form-item label="银行编号" required label-width="250">
						<u-input placeholder="此处必填…" v-model="form.bankCode" type="text" />
					</u-form-item>
					<u-form-item label="银行名称" required label-width="250">
						<u-input placeholder="此处必填…" v-model="form.bankName" type="text" />
					</u-form-item>
				</u-form>
			</view>
		</view>
		
		<view class="btn-box">
			<u-button type="primary" @click="submit">确认添加</u-button>
		</view>
		
	</view>
</template>

<script>
	export default {
		props: {
			desc: String,
			title: String,
		},
		data() {
			return {
				orderId: null,
				form: {
					bankHolder: '',
					bankAccount: '',
					bankDaHangCode: '',
					bankAreaCode: '',
					bankCode: '',
					bankName: '',
					mdmMerchantOrderId: ''
				}
			}
		},
		onLoad(option) {
			this.orderId = option.id;
	    },
		methods: {
			submit() {
				this.form.mdmMerchantOrderId = this.orderId;
				this.$u.post('/dcc-merchant/mdmmerchantbankorder/submit', this.form).then(res => {
					this.$u.toast('保存成功');
					this.$u.route({
						url: 'pages/login/file',
						params: {
							id: this.orderId
						}
					});
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.card-box {
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: #fff;
		padding: 30px 0;
	}
	.card-info {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	.card-title {
		font-size: 15px;
		font-weight: bold;
	}
	.card-tip {
		font-size: 12px;
		font-weight: bold;
		margin-top: 10px;
	}
	.border-bottom {
		position: relative;
	}
	.border-bottom:before {
		content: " ";
		width: 200%;
		height: 200%;
		position: absolute;
		top: 0;
		left: 0;
		border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
		-webkit-transform: scale(0.5);
		transform: scale(0.5);
		-webkit-transform-origin: 0 0;
		transform-origin: 0 0;
		box-sizing: border-box;
	}
	.form {
		
	}
	.form-box {
		padding: 0 20px;
		background-color: #fff;
		margin-bottom: 10px;
	}
	.btn-box {
		display: flex;
		justify-content: space-between;
		padding: 20px 0;
		padding-bottom: 40px;
		padding-left: 15px;
		padding-right: 15px;
	}
	.u-size-default {
		width: 100%;
		margin-right: 20px;
	}
	.btn-box .u-size-default:last-child {
		margin-right: 0;
	}
</style>
